package com.demo.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.demo.model.ResQuestion;

public class QuestionRowMapper implements RowMapper{

	@Override
	public ResQuestion mapRow(ResultSet rs, int index) throws SQLException {
		ResQuestion question = new ResQuestion();
		
		question.setCrawlerId(rs.getInt("id"));
     	question.setGradeId((rs.getInt("grade_id")));
     	question.setSubjectId((rs.getInt("subject_id")));
     	question.setType((rs.getInt("type")));
     	question.setRank((rs.getInt("rank")));
     	question.setContent((rs.getString("question")));
     	question.setAnswer((rs.getString("answer")));
     	question.setOptions((rs.getString("options")));
     	question.setAnalysis((rs.getString("ana")));
     	question.setKnowledgeId(rs.getInt("knowledge_id"));
     	question.setChapterId(rs.getInt("chapter_id"));
     	
     	
		return question;
	}

}
